package prehilife;

import java.util.Iterator;

public class Hut extends StaticCreature {

    private PrehiWorld world;

    public Hut(PrehiWorld world) {
        this.world = world;
    }

    public void healMembers() {
        Iterator<Creature> whoInMe = world.myGameBoard[super.getPositionX()][super.getPositionY()].iterator();
        while(whoInMe.hasNext()){
            Creature creature=whoInMe.next();
            if(creature instanceof Member){
                Member memb=(Member)creature;
                if(memb.getHp()<world.maxHP){
                    memb.setHp(memb.getHp()+1);
                }
            }
        }
    }

    @Override
    public void evolve() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void unevolve() {
        throw new UnsupportedOperationException("Not supported yet.");
    }
}